open_init_pty: Do not make stdin and stdout non-blocking
Quoted 4 lines
commit
fb081eb64b36a9de5a43f3d69d9e628b6eb1afc7(HEAD -> master, origin/master)Author: Stephen Smalley <[email protected]> Date: Mon Jul 10 13:03:01 2017 -0400
Quoted 8 lines
open_init_pty: Do not make stdin and stdout non-blockingIt is unclear why this was being done in the first place, and it has caused multiple bugs with run_init/open_init_pty usage.
I see you fixed the issue with run_init/open_init_pty messing up with the terminals but I think it's introducing an other issue :/
FTR I found the reason why stdin/stdout were not blocking, it's a fix for this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474956#10
Apparently if the descriptors are closed, open_init_pty hangs, example:
./open_init_pty bash -c 'echo hello; exec >&- 2>&- <&-; sleep 1; '